package net.pws.oos.biz.query;

import java.util.List;
import java.util.Map;

import net.pws.oos.biz.model.Organization;
import net.pws.oos.biz.model.Role;
import net.pws.oos.biz.model.User;
import net.pws.oos.biz.query.parameter.OperateLogQueryParameter;
import net.pws.oos.biz.query.parameter.OrganizationQueryParameter;
import net.pws.oos.biz.query.parameter.RoleQueryParameter;
import net.pws.oos.biz.query.parameter.UserQueryParameter;

@SuppressWarnings("rawtypes")
public interface SystemManageFinder {
    
    /**
     * @param id
     * @return
     */
    public User getUser(String id);
    
    /**
     * 针对延迟加载
     * 
     * @param id
     * @return
     */
    public User getUserMap(String id);
    
    /**
     * @param id
     * @return
     */
    public Role getRole(String id);
    
    /**
     * @param queryParameter
     * @return
     */
    public int countUser(UserQueryParameter queryParameter);
    
    /**
     * @param queryParameter
     * @param start
     * @param limit
     * @return
     */
    public List<User> getUserList(UserQueryParameter queryParameter,
                                  int start,
                                  int limit);
    
    public int countUserWithRoles(UserQueryParameter queryParameter);
    
    public List<Map> listUserWithRoles(UserQueryParameter queryParameter);
    
    /**
     * 获得指定组织机构的人员
     * 
     * @param organId
     * @return
     */
    public List<User> getUserListByOrgan(String organId);
    
    /**
     * 获得指定组织机构及下属机构的人员
     * 
     * @param organId
     * @return
     */
    public List<User> getUserListByOrganTree(String organId);
    
    /**
     * 根据指定的ID获得人员
     * 
     * @param ids
     *            以逗号分隔的人员ID
     * @return
     */
    public List<User> getUserList(String ids);
    
    /**
     * 针对延迟加载
     * 
     * @param queryParameter
     * @param start
     * @param limit
     * @return
     */
    public List<Map> getUserMapList(UserQueryParameter queryParameter,
                                    int start,
                                    int limit);
    
    /**
     * @param queryParameter
     * @return
     */
    public int countOurUser(UserQueryParameter queryParameter);
    
    /**
     * @param queryParameter
     * @param start
     * @param limit
     * @return
     */
    public List<User> getOurUserList(UserQueryParameter queryParameter,
                                     int start,
                                     int limit);
    
    /**
     * 针对延迟加载
     * 
     * @param queryParameter
     * @param start
     * @param limit
     * @return
     */
    public List<Map> getOurUserMapList(UserQueryParameter queryParameter,
                                       int start,
                                       int limit);
    
    /**
     * @param roleId
     * @return
     */
    public int countBindedUser(String roleId);
    
    /**
     * @param roleId
     * @param start
     * @param limit
     * @return
     */
    public List<Map> getBindedUserList(String roleId, int start, int limit);
    
    /**
     * @param queryParameter
     * @return
     */
    public int countUnbindedUser(RoleQueryParameter queryParameter);
    
    /**
     * @param queryParameter
     * @param start
     * @param limit
     * @return
     */
    public List<Map> getUnbindedUserList(RoleQueryParameter queryParameter,
                                         int start,
                                         int limit);
    
    /**
     * @param userId
     * @return
     */
    public int countBindedRole(String userId);
    
    /**
     * @param userId
     * @param start
     * @param limit
     * @return
     */
    public List<Map> getBindedRoleList(String userId, int start, int limit);
    
    /**
     * @param queryParameter
     * @return
     */
    public int countUnbindedRole(UserQueryParameter queryParameter);
    
    /**
     * @param queryParameter
     * @param start
     * @param limit
     * @return
     */
    public List<Map> getUnbindedRoleList(UserQueryParameter queryParameter,
                                         int start,
                                         int limit);
    
    /**
     * @param queryParameter
     * @return
     */
    public int countRole(RoleQueryParameter queryParameter);
    
    /**
     * @param queryParameter
     * @param start
     * @param limit
     * @return
     */
    public List<Role> getRoleList(RoleQueryParameter queryParameter,
                                  int start,
                                  int limit);
    
    /**
     * @param queryParameter
     * @return
     */
    public int countOrganization(OrganizationQueryParameter queryParameter);
    
    /**
     * @param queryParameter
     * @param start
     * @param limit
     * @return
     */
    public List<Organization> getOrganizationList(OrganizationQueryParameter queryParameter,
                                                  int start,
                                                  int limit);
    
    /**
     * 针对延迟加载，直接将map映射到页面
     * 
     * @param queryParameter
     * @param start
     * @param limit
     * @return
     */
    public List<Map> getOrganizationMapList(OrganizationQueryParameter queryParameter,
                                            int start,
                                            int limit);
    
    /**
     * @param id
     * @return
     */
    public List<Organization> getOrganizationChildren(String id);
    
    /**
     * @param id
     * @param excludeId
     * @return
     */
    public List<Organization> getOrganizationChildren(String id,
                                                      String excludeId);
    
    /**
     * @param queryParameter
     * @return
     */
    public int countOurOrganization(OrganizationQueryParameter queryParameter);
    
    /**
     * @param queryParameter
     * @param start
     * @param limit
     * @return
     */
    public List<Organization> getOurOrganizationList(OrganizationQueryParameter queryParameter,
                                                     int start,
                                                     int limit);
    
    /**
     * 针对延迟加载，直接将map映射到页面
     * 
     * @param queryParameter
     * @param start
     * @param limit
     * @return
     */
    public List<Map> getOurOrganizationMapList(OrganizationQueryParameter queryParameter,
                                               int start,
                                               int limit);
    
    /**
     * @param id
     * @return
     */
    public Organization getOrganization(String id);
    
    /**
     * 针对延迟加载
     * 
     * @param id
     * @return
     */
    public Organization getOrganizationMap(String id);
    
    /**
     * 根据id和深度获得某级别的机构
     * 
     * @param id
     * @param depth
     * @return
     */
    public Organization getDepthOrganization(String id, int depth);
    
    public int countOperateLog(OperateLogQueryParameter queryParameter);
    
    public List<Map> listOperateLog(OperateLogQueryParameter queryParameter);
}
